940 REM The IBM Personal Computer Calendar
950 REM Version 1.00 (C)Copyright IBM Corp 1981
960 REM Licensed Material - Program Property of IBM
975 DEF SEG: POKE 106,0
980 SAMPLES$="NO"
990 GOTO 1010
1000 SAMPLES$ = "YES"
1010 KEY OFF:SCREEN 0,1:COLOR 15,0,0:WIDTH 40:CLS:LOCATE 5,19:PRINT "IBM"
1020 LOCATE 7,12,0:PRINT "Personal Computer"
1030 COLOR 10,0:LOCATE 10,9,0:PRINT CHR$(213)+STRING$(21,205)+CHR$(184)
1040 LOCATE 11,9,0:PRINT CHR$(179)+"      CALENDAR       "+CHR$(179)
1050 LOCATE 12,9,0:PRINT CHR$(179)+STRING$(21,32)+CHR$(179)
1060 LOCATE 13,9,0:PRINT CHR$(179)+"    Version 1.00     "+CHR$(179)
1070 LOCATE 14,9,0:PRINT CHR$(212)+STRING$(21,205)+CHR$(190)
1080 COLOR 15,0:LOCATE 17,7,0:PRINT "(C) Copyright IBM Corp 1981"
1090 COLOR 14,0:LOCATE 23,7,0:PRINT "Press space bar to continue"
1100 IF INKEY$ <> "" THEN GOTO 1100
1110 CMD$ = INKEY$
1120 IF CMD$ = " " THEN GOTO 1150
1130 IF CMD$ = CHR$(27) THEN GOTO 2290
1140 GOTO 1110
1150 COLOR 15,0:CLS
1160 DIM M$(19),MONTH$(2,19),MNAME$(12),DAYS(12)
1190 MNAME$(1) = " JANUARY " : MNAME$(2) = "FEBRUARY "
1210 MNAME$(3) = "  MARCH  " : MNAME$(4) = "  APRIL  "
1230 MNAME$(5) = "   MAY   " : MNAME$(6) = "  JUNE   "
1250 MNAME$(7) = "  JULY   " : MNAME$(8) = " AUGUST  "
1270 MNAME$(9) = "SEPTEMBER" : MNAME$(10)= " OCTOBER "
1290 MNAME$(11)= " NOVEMBER" : MNAME$(12)= "DECEMBER "
1320 DAYS ( 1) = 31 : DAYS ( 2) = 28 : DAYS ( 3) = 31 : DAYS ( 4) = 30
1340 DAYS ( 5) = 31 : DAYS ( 6) = 30 : DAYS ( 7) = 31 : DAYS ( 8) = 31
1360 DAYS ( 9) = 30 : DAYS (10) = 31 : DAYS (11) = 30 : DAYS (12) = 31
1380 DIM YEARS(20)
1390 YEARS ( 1) = 4 : YEARS ( 2) = 5 : YEARS ( 3) = 6 : YEARS ( 4) = 0
1410 YEARS ( 5) = 2 : YEARS ( 6) = 3 : YEARS ( 7) = 4 : YEARS ( 8) = 5
1430 YEARS ( 9) = 0
1440 M$(1) = CHR$(192)+STRING$(35,208)
1450 T$ = "    "+CHR$(202) : M$(2)=CHR$(202)+T$+T$+T$+T$+T$+T$+T$:M$(3)=M$(2)
1480 T$ = STRING$(4,208)+CHR$(218) : M$(4)=CHR$(202)+T$+T$+T$+T$+T$+T$+T$
1500 FOR I = 5 TO 19:M$(I) = M$(I-3):NEXT I
1527 LOCATE 3,1
1528 PRINT "ENTER 0 TO END"
1529 PRINT "THE PROGRAM.":LOCATE 1,1
1530 LINE INPUT "ENTER YEAR (1981-1989) ==> ";YR$
1540 IF YR$="0"    THEN      GOTO 2290
1550 IF YR$="1981" THEN YR=1:GOTO 1730
1560 IF YR$="1982" THEN YR=2:GOTO 1730
1570 IF YR$="1983" THEN YR=3:GOTO 1730
1580 IF YR$="1984" THEN YR=4:GOTO 1730
1590 IF YR$="1985" THEN YR=5:GOTO 1730
1600 IF YR$="1986" THEN YR=6:GOTO 1730
1610 IF YR$="1987" THEN YR=7:GOTO 1730
1620 IF YR$="1988" THEN YR=8:GOTO 1730
1630 IF YR$="1989" THEN YR=9:GOTO 1730
1640 PRINT ""
1650 PRINT "YEAR MUST BE A NUMBER"
1660 PRINT "FROM 1981 TO 1989."
1670 PRINT ""
1680 PRINT "ENTER 0 TO END"
1690 PRINT "THE PROGRAM."
1700 PRINT ""
1710 PRINT ""
1720 GOTO 1530
1730 Y = YEARS(YR)
1740 IF YR = 1984 THEN DAYS(2)=29
1750 IF YR = 1988 THEN DAYS(2)=29
1770 PRINT ""
1780 PRINT "POSITION PAPER AND PRESS SPACE BAR"
1790 PRINT "WHEN THE IBM PERSONAL COMPUTER"
1800 PRINT "PRINTER IS READY"
1810 PRINT ""
1820 PRINT ""
1830 IF INKEY$ <> "" THEN GOTO 1830
1840 CMD$ = INKEY$
1850 IF CMD$ = " " THEN GOTO 1880
1860 IF CMD$ = CHR$(27) THEN GOTO 2290
1870 GOTO 1840
1880 PRINT "PRINTING CALENDAR FOR THE YEAR, ";YR$;","
1890 PRINT "PRESS THE ESC KEY TO EXIT."
1900 FOR P = 0 TO 2
1910 LPRINT CHR$(15);
1920 LPRINT "        (C) COPYRIGHT IBM CORPORATION 1981"
1930 LPRINT CHR$(18);
1940 FOR SKIP=1 TO 1:LPRINT"":NEXT SKIP
1950 LPRINT CHR$(14);CHR$(27);CHR$(69);
1960 LPRINT "    THE IBM PERSONAL COMPUTER CALENDAR"
1970 LPRINT CHR$(14);CHR$(27);CHR$(69);
1980 LPRINT "                  ";1980+YR
1990 FOR SKIP=1 TO 2:LPRINT"":NEXT SKIP
2000 FOR M = (1+P*4) TO (3+P*4) STEP 2
2010 FOR SKIP=1 TO 2:LPRINT"":NEXT SKIP
2020 LPRINT CHR$(14);CHR$(27);CHR$(69);
2030 LPRINT "       ";MNAME$(M);"          ";MNAME$(M+1)
2040 LPRINT CHR$(27);CHR$(70);
2050 FOR I = 1 TO 19
2060 MONTH$(1,I) = M$(I)
2070 MONTH$(2,I) = M$(I)
2080 NEXT I
2090 FOR SKIP=1 TO 1:LPRINT"":NEXT SKIP
2100 FOR J = 1 TO DAYS(M)
2110 K = (Y+J-1) MOD 7:L = INT((Y+J-1)/7)
2120 MID$(MONTH$(1,2+L*3),2+K*5) = MID$(STR$(J),2,2)
2130 NEXT J
2140 Y = (Y+(DAYS(M) MOD 7)) MOD 7
2150 FOR J = 1 TO DAYS(M+1)
2160 K = (Y+J-1) MOD 7:L = INT((Y+J-1)/7)
2170 MID$(MONTH$(2,2+L*3),2+K*5) = MID$(STR$(J),2,2)
2180 NEXT J
2190 Y = (Y+(DAYS(M+1) MOD 7)) MOD 7
2200 LPRINT "      SUN  MON  TUE  WED  THU  FRI  SAT      SUN  MON  TUE  WED  THU  FRI  SAT"
2210 FOR I = 1 TO 19:LPRINT "    ";MONTH$(1,I);"   ";MONTH$(2,I)
2230 IF INKEY$ = CHR$(27) THEN GOTO 2290
2240 NEXT I
2250 FOR SKIP=1 TO 4:LPRINT"":NEXT SKIP : NEXT M
2270 FOR SKIP=1 TO 4:LPRINT"":NEXT SKIP : NEXT P
2290 IF SAMPLES$ = "YES" THEN CHAIN "SAMPLES",1000
2300 SCREEN 0:COLOR 7,0:CLS
